package com.woniu.sharepark.util.Calculate;

import java.util.Date;

/**
 * 时间计算
 * @author DELL
 * @date 2019/6/14 10:47
 * version v1.0
 */
public class TimeUtil {

    /**
    * 计算时间差 返回小时数
    * @title timeNum
    * @param endTime
    * @return int
    * @author DELL
    * @date 2019/6/14 10:50
    **/

    public static long timeNum(Date endTime) {

        Date date = new Date();
        Long time1 = endTime.getTime() / (1000*60);
        Long time2 = date.getTime() / (1000*60);
        Long count = time1-time2;
        System.out.println("分钟数"+count);
        Long result = count / 60;
        if (count % 60 != 0){
            result +=1;
        }

        return result;
    }
}
